package org.example.day;

/**
 * @Description: TODO
 * @Author wyatt
 * @Data 2024/08/18 9:23
 */
public class Solution551 {

    public boolean checkRecord(String s) {
        int sumA = 0;
        int sumL = 0;

        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == 'A'){
                sumA++;
                sumL = 0;
                if(sumA >= 2){
                    return false;
                }
            }else if(s.charAt(i) == 'L'){
                sumL++;
                if(sumL >= 3){
                    return false;
                }
            }else {
                sumL = 0;
            }
        }
        return true;
    }

}
